{extend name="public/base"}

{block name="title"}就行天下-店铺审核{/block}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/home/css/index.css" />
{/block}

{block name="main"}
<div class="pageControl productList bg-f7">
    <div class="main-top"></div>
    <div class="msui_nav msui_navTop noBorder">
        <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
        <h1 class="msui_navTop-title">补货记录</h1>
        <a href="" class="msui_navTop-right msui_navTop-cnav"><i class="micon-cnav"></i></a>
    </div>
    <div class="mtab_list mtop05" style="position: relative;">
        <div class="js-list active">
            {empty name="data.list"}
                <p style="text-align: center; ">暂无记录</p>
            {else /}
            {volist name="data.list" id="vo"}
                <div class="weui-cell repertory" style="margin-bottom: 10px;">
                    <div class="weui-cell__hd">
                        <img src="{$vo.product_thumb}" alt="">
                    </div>
                    <div class="weui-cell__bd">
                        <p>{$vo.product_name}</p>
                        <p class="inventory">补充数量：<span class="remainder">{$vo.num}</span></p>
                        <p>备注：<span>{$vo.msg}</span></p>
                    </div>
                    <div class="weui-cell__ft">
                        <p class="repertory-title cl-3333">{$vo.status_text}</p>
                        {eq name="vo.status" value="1"}
                        <a href="javascript:;" data-href="{:url('replenishment_cancel', ['id' => $vo['id'], 'shop_id' => $shop_id])}" class="repertory-btn replenishment_btn" data-title="确认取消该申请？">取消</a>
                        {/eq}
                        {eq name="vo.status" value="2"}
                        <a href="javascript:;" data-href="{:url('replenishment_confirm_receipt', ['id' => $vo['id'], 'shop_id' => $shop_id])}" class="repertory-btn replenishment_btn" data-title="请确认已收到商品？">确认收货</a>
                        {/eq}
                    </div>
                </div>
            {/volist}
            {/empty}
        </div>
    </div>
</div>
{/block}

{block name="javascript"}
<script>
    $(function () {
        $(".replenishment_btn").click(function () {
            var _this = $(this);
            $.confirm(_this.data('title'), function() {
                //点击确认后的回调函数
                $.get(_this.data('href'), function (msg) {
                    if (msg.code == 200) {
                        $.toptip('确认成功！', 'success');
                        setTimeout(function () {
                            window.location.reload();
                        }, 888);
                    } else {
                        $.toptip('确认失败！', 'error');
                    }
                }, 'json');
            }, function() {
                //点击取消后的回调函数
            });
        }); 
    });
</script>
{/block}